package com.gjy.pd.specification;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2023-01-17 14:37:47
 */
public abstract class CompositeSpecification implements ISpecification {

    public abstract boolean isSatisfiedBy(Object candidate);

    public ISpecification and(ISpecification spec) {
        return new AndSpecification(this, spec);
    }

    public ISpecification or(ISpecification spec) {
        return new OrSpecification(this, spec);
    }

    public ISpecification not() {
        return new NotSpecification(this);
    }
}
